﻿/**********************************************************************
 * @file   GUIPickWidget.h
 * @brief  拾取界面
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-12-25
 *********************************************************************/
#ifndef GUIPickWidget_H
#define GUIPickWidget_H

#include "GUIToolDialogAPI.h"
#include "GUIWidget/GUIWidgetBase.h"

class QButtonGroup;

namespace Ui {
    class GUIPickWidget;
}

namespace GUI
{
    /**
     * @brief  拾取类型枚举
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-12-25
     */
    enum class GUIDialogPickType {
        None = -1,
        Geometry,          ///几何
        SubSysteam,        ///子系统
        Load,              ///载荷
        Junction,          ///连接
    };
    /**
     * @brief  拾取对话框
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-12-25
     */
    class GUIToolDialogAPI GUIPickWidget : public GUIWidgetBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-25
         */
        GUIPickWidget();
        /**
         * @brief    析构函数
         * @return   void
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-25
         */
        virtual ~GUIPickWidget();
        /**
         * @brief    获取当前拾取类型
         * @return   GUIDialogPickType      当前拾取类型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-25
         */
        GUIDialogPickType getCurrentPickType();
        /**
         * @brief    获取拾取到的数据
         * @return   QList<int>         拾取到的数据
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-24
         */
        QList<int> getPickValue();
        /**
         * @brief    重置拾取模式为空
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-25
         */
        void resetPickToNone();
        /**
         * @brief    重置拾取模式至当前选项
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-25
         */
        void resetPickToCurrentSelect();
    private slots:
        ;
        /**
         * @brief    radio按钮点击事件
         * @param[i] id            radio按钮id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-23
         */
        void slotRadioButtonClicked(int id);
    private:
        /**
         * @brief    选择拾取模式
         * @param[i] type           拾取类型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-27
         */
        void switchPickModel(GUIDialogPickType type);
    private:
        /**
         * @brief  ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-25
         */
        Ui::GUIPickWidget* _ui = nullptr;
        /**
         * @brief  radio按钮组
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-25
         */
        QButtonGroup* _radioButtonGroup = nullptr;
    };
}
#endif
